﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GenericStateMachine
{
    /// <summary>
    /// Specifies the group of state.
    /// </summary>
    public enum StateGroup
    {
        /// <summary>
        /// Unspecified group.
        /// </summary>
        None,

        /// <summary>
        /// Initial state.
        /// </summary>
        Initial,
    }
    
    /// <summary>
    /// Associates the state enumeration with the concrete state class.
    /// </summary>
    [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
    public class StateAttribute : Attribute
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="StateAttribute"/> class.
        /// </summary>
        /// <param name="stateClass">The concrete state class.</param>
        public StateAttribute(Type stateClass)
            : this(stateClass, StateGroup.None)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="StateAttribute"/> class.
        /// </summary>
        /// <param name="stateClass">The concrete state class.</param>
        /// <param name="stateGroup">The group of state.</param>
        public StateAttribute(Type stateClass, StateGroup stateGroup)
        {
            StateClass = stateClass;
            StateGroup = stateGroup;
        }

        /// <summary>
        /// Gets the concrete state class. 
        /// </summary>
        public Type StateClass { get; private set; }

        /// <summary>
        /// Gets the group of state.
        /// </summary>
        public StateGroup StateGroup { get; private set; }
    }
}
